package com.bookdresser.activities;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.Button;

import com.bookdresser.R;

public final class PostFragment extends Fragment {

	private Context context;

	public static PostFragment newInstance(Context context) {
		PostFragment fragment = new PostFragment();
		fragment.context = context;
		return fragment;
	}

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		View view = inflater.inflate(R.layout.tab_post, null);

		Button bt_post = (Button) view.findViewById(R.id.bt_post);
		Button bt_posted = (Button) view.findViewById(R.id.bt_posted);

		bt_post.setOnClickListener(new PostClickListener());

		return view;
	}

	private class PostClickListener implements OnClickListener {

		@Override
		public void onClick(View arg0) {
			Intent intent = new Intent();
			intent.setClass(context, InfoActivity.class);
			startActivity(intent);
		}
	}

}
